home *** CD-ROM | disk | FTP | other *** search
/ Interactive Quarterly / The Best of New Machine Publishing 1 - Disc 4: Interactive Quarterly.iso / pc / demos / az / cyberx.dxr / 00192_ESCRITURA DE LOS VALORES DEL JUEGO.ls < prev    next >
Encoding:
Text File  |  1996-10-06  |  10.2 KB  |  347 lines

  1. on EcrValores
  2.   global PathStart, codigo, cal_1, cal_2, cal_3, vida, escudo, Niv, Sala, Punto, muerte, calibre, TabBatallas, Tabcajas, cinta, pase, video, idioma, full_video, niv_sonido1, niv_sonido2
  3.   set total to EMPTY
  4.   set total to total & Niv
  5.   set total to total & Sala
  6.   if Punto > 999 then
  7.     set Num to EMPTY & Punto
  8.   else
  9.     if Punto > 99 then
  10.       set Num to "0" & Punto
  11.     else
  12.       if Punto > 9 then
  13.         set Num to "00" & Punto
  14.       else
  15.         set Num to "000" & Punto
  16.       end if
  17.     end if
  18.   end if
  19.   set total to total & Num
  20.   if cal_1 < 0 then
  21.     set cal_1 to 0
  22.   end if
  23.   if cal_1 > 9 then
  24.     set Num to EMPTY & cal_1
  25.   else
  26.     set Num to "0" & cal_1
  27.   end if
  28.   set total to total & Num
  29.   if cal_2 < 0 then
  30.     set cal_2 to 0
  31.   end if
  32.   if cal_2 > 9 then
  33.     set Num to EMPTY & cal_2
  34.   else
  35.     set Num to "0" & cal_2
  36.   end if
  37.   set total to total & Num
  38.   if cal_3 < 0 then
  39.     set cal_3 to 0
  40.   end if
  41.   if cal_3 > 9 then
  42.     set Num to EMPTY & cal_3
  43.   else
  44.     set Num to "0" & cal_3
  45.   end if
  46.   set total to total & Num
  47.   if vida < 0 then
  48.     set vida to 0
  49.   end if
  50.   if vida > 9 then
  51.     set Num to EMPTY & vida
  52.   else
  53.     set Num to "0" & vida
  54.   end if
  55.   set total to total & Num
  56.   if escudo < 0 then
  57.     set escudo to 0
  58.   end if
  59.   if escudo > 9 then
  60.     set Num to EMPTY & escudo
  61.   else
  62.     set Num to "0" & escudo
  63.   end if
  64.   set total to total & Num
  65.   set total to total & cinta
  66.   set total to total & pase
  67.   if video > 9 then
  68.     set Num to EMPTY & video
  69.   else
  70.     set Num to "0" & video
  71.   end if
  72.   set total to total & Num
  73.   set total to total & idioma
  74.   set total to total & full_video
  75.   if niv_sonido1 > 99 then
  76.     set Num to EMPTY & niv_sonido1
  77.   else
  78.     if niv_sonido1 > 9 then
  79.       set Num to "0" & niv_sonido1
  80.     else
  81.       set Num to "00" & niv_sonido1
  82.     end if
  83.   end if
  84.   set total to total & Num
  85.   if niv_sonido2 > 99 then
  86.     set Num to EMPTY & niv_sonido2
  87.   else
  88.     if niv_sonido2 > 9 then
  89.       set Num to "0" & niv_sonido2
  90.     else
  91.       set Num to "00" & niv_sonido2
  92.     end if
  93.   end if
  94.   set total to total & Num
  95.   set largo to count(TabBatallas)
  96.   if largo < 6 then
  97.     alert("ERROR COMBATES")
  98.   end if
  99.   repeat with i = 1 to largo
  100.     set total to total & getAt(TabBatallas, i)
  101.   end repeat
  102.   set largo to count(Tabcajas)
  103.   if largo < 50 then
  104.     alert("ERROR CAJAS")
  105.   end if
  106.   repeat with i = 1 to largo
  107.     if getAt(Tabcajas, i) > 9 then
  108.       set Num to getAt(Tabcajas, i)
  109.     else
  110.       set Num to "0" & getAt(Tabcajas, i)
  111.     end if
  112.     set total to total & Num
  113.   end repeat
  114.   set total to total & muerte
  115.   set total to total & calibre
  116.   set largo to length(total)
  117.   set suma to 0
  118.   repeat with i = 1 to largo
  119.     set suma to suma + integer(char i of total)
  120.   end repeat
  121.   if suma > 999 then
  122.     set Num to EMPTY & suma
  123.   else
  124.     if suma > 99 then
  125.       set Num to "0" & suma
  126.     else
  127.       if suma > 9 then
  128.         set Num to "00" & suma
  129.       else
  130.         set Num to "000" & suma
  131.       end if
  132.     end if
  133.   end if
  134.   set total to total & Num
  135.   set TotalRec to EMPTY
  136.   set Trozo to char 1 to 5 of total
  137.   set result to integer(Trozo) / 8
  138.   set Resto to integer(Trozo) mod 8
  139.   set Zeros to 1
  140.   repeat while char Zeros to Zeros of Trozo = "0"
  141.     set Zeros to Zeros + 1
  142.   end repeat
  143.   set Zeros to Zeros - 1
  144.   set TotalRec to TotalRec & Resto & length(result & EMPTY) & result & Zeros
  145.   set Trozo to char 6 to 11 of total
  146.   set result to integer(Trozo) / 7
  147.   set Resto to integer(Trozo) mod 7
  148.   set Zeros to 1
  149.   repeat while char Zeros to Zeros of Trozo = "0"
  150.     set Zeros to Zeros + 1
  151.   end repeat
  152.   set Zeros to Zeros - 1
  153.   set TotalRec to TotalRec & Resto & length(result & EMPTY) & result & Zeros
  154.   set Trozo to char 12 to 15 of total
  155.   set result to integer(Trozo) / 3
  156.   set Resto to integer(Trozo) mod 3
  157.   set Zeros to 1
  158.   repeat while char Zeros to Zeros of Trozo = "0"
  159.     set Zeros to Zeros + 1
  160.   end repeat
  161.   set Zeros to Zeros - 1
  162.   set TotalRec to TotalRec & Resto & length(result & EMPTY) & result & Zeros
  163.   set Trozo to char 16 to 23 of total
  164.   set result to integer(Trozo) / 7
  165.   set Resto to integer(Trozo) mod 7
  166.   set Zeros to 1
  167.   repeat while char Zeros to Zeros of Trozo = "0"
  168.     set Zeros to Zeros + 1
  169.   end repeat
  170.   set Zeros to Zeros - 1
  171.   set TotalRec to TotalRec & Resto & length(result & EMPTY) & result & Zeros
  172.   set Trozo to char 24 to 31 of total
  173.   set result to integer(Trozo) / 9
  174.   set Resto to integer(Trozo) mod 9
  175.   set Zeros to 1
  176.   repeat while char Zeros to Zeros of Trozo = "0"
  177.     set Zeros to Zeros + 1
  178.   end repeat
  179.   set Zeros to Zeros - 1
  180.   set TotalRec to TotalRec & Resto & length(result & EMPTY) & result & Zeros
  181.   set Trozo to char 32 to 36 of total
  182.   set result to integer(Trozo) / 9
  183.   set Resto to integer(Trozo) mod 9
  184.   set Zeros to 1
  185.   repeat while char Zeros to Zeros of Trozo = "0"
  186.     set Zeros to Zeros + 1
  187.   end repeat
  188.   set Zeros to Zeros - 1
  189.   set TotalRec to TotalRec & Resto & length(result & EMPTY) & result & Zeros
  190.   set Trozo to char 37 to 43 of total
  191.   set result to integer(Trozo) / 7
  192.   set Resto to integer(Trozo) mod 7
  193.   set Zeros to 1
  194.   repeat while char Zeros to Zeros of Trozo = "0"
  195.     set Zeros to Zeros + 1
  196.   end repeat
  197.   set Zeros to Zeros - 1
  198.   set TotalRec to TotalRec & Resto & length(result & EMPTY) & result & Zeros
  199.   set Trozo to char 44 to 48 of total
  200.   set result to integer(Trozo) / 8
  201.   set Resto to integer(Trozo) mod 8
  202.   set Zeros to 1
  203.   repeat while char Zeros to Zeros of Trozo = "0"
  204.     set Zeros to Zeros + 1
  205.   end repeat
  206.   set Zeros to Zeros - 1
  207.   set TotalRec to TotalRec & Resto & length(result & EMPTY) & result & Zeros
  208.   set Trozo to char 49 to 54 of total
  209.   set result to integer(Trozo) / 7
  210.   set Resto to integer(Trozo) mod 7
  211.   set Zeros to 1
  212.   repeat while char Zeros to Zeros of Trozo = "0"
  213.     set Zeros to Zeros + 1
  214.   end repeat
  215.   set Zeros to Zeros - 1
  216.   set TotalRec to TotalRec & Resto & length(result & EMPTY) & result & Zeros
  217.   set Trozo to char 55 to 58 of total
  218.   set result to integer(Trozo) / 3
  219.   set Resto to integer(Trozo) mod 3
  220.   set Zeros to 1
  221.   repeat while char Zeros to Zeros of Trozo = "0"
  222.     set Zeros to Zeros + 1
  223.   end repeat
  224.   set Zeros to Zeros - 1
  225.   set TotalRec to TotalRec & Resto & length(result & EMPTY) & result & Zeros
  226.   set Trozo to char 59 to 66 of total
  227.   set result to integer(Trozo) / 7
  228.   set Resto to integer(Trozo) mod 7
  229.   set Zeros to 1
  230.   repeat while char Zeros to Zeros of Trozo = "0"
  231.     set Zeros to Zeros + 1
  232.   end repeat
  233.   set Zeros to Zeros - 1
  234.   set TotalRec to TotalRec & Resto & length(result & EMPTY) & result & Zeros
  235.   set Trozo to char 67 to 74 of total
  236.   set result to integer(Trozo) / 9
  237.   set Resto to integer(Trozo) mod 9
  238.   set Zeros to 1
  239.   repeat while char Zeros to Zeros of Trozo = "0"
  240.     set Zeros to Zeros + 1
  241.   end repeat
  242.   set Zeros to Zeros - 1
  243.   set TotalRec to TotalRec & Resto & length(result & EMPTY) & result & Zeros
  244.   set Trozo to char 75 to 79 of total
  245.   set result to integer(Trozo) / 9
  246.   set Resto to integer(Trozo) mod 9
  247.   set Zeros to 1
  248.   repeat while char Zeros to Zeros of Trozo = "0"
  249.     set Zeros to Zeros + 1
  250.   end repeat
  251.   set Zeros to Zeros - 1
  252.   set TotalRec to TotalRec & Resto & length(result & EMPTY) & result & Zeros
  253.   set Trozo to char 80 to 86 of total
  254.   set result to integer(Trozo) / 7
  255.   set Resto to integer(Trozo) mod 7
  256.   set Zeros to 1
  257.   repeat while char Zeros to Zeros of Trozo = "0"
  258.     set Zeros to Zeros + 1
  259.   end repeat
  260.   set Zeros to Zeros - 1
  261.   set TotalRec to TotalRec & Resto & length(result & EMPTY) & result & Zeros
  262.   set Trozo to char 87 to 92 of total
  263.   set result to integer(Trozo) / 7
  264.   set Resto to integer(Trozo) mod 7
  265.   set Zeros to 1
  266.   repeat while char Zeros to Zeros of Trozo = "0"
  267.     set Zeros to Zeros + 1
  268.   end repeat
  269.   set Zeros to Zeros - 1
  270.   set TotalRec to TotalRec & Resto & length(result & EMPTY) & result & Zeros
  271.   set Trozo to char 93 to 100 of total
  272.   set result to integer(Trozo) / 5
  273.   set Resto to integer(Trozo) mod 5
  274.   set Zeros to 1
  275.   repeat while char Zeros to Zeros of Trozo = "0"
  276.     set Zeros to Zeros + 1
  277.   end repeat
  278.   set Zeros to Zeros - 1
  279.   set TotalRec to TotalRec & Resto & length(result & EMPTY) & result & Zeros
  280.   set Trozo to char 101 to 106 of total
  281.   set result to integer(Trozo) / 8
  282.   set Resto to integer(Trozo) mod 8
  283.   set Zeros to 1
  284.   repeat while char Zeros to Zeros of Trozo = "0"
  285.     set Zeros to Zeros + 1
  286.   end repeat
  287.   set Zeros to Zeros - 1
  288.   set TotalRec to TotalRec & Resto & length(result & EMPTY) & result & Zeros
  289.   set Trozo to char 107 to 111 of total
  290.   set result to integer(Trozo) / 9
  291.   set Resto to integer(Trozo) mod 9
  292.   set Zeros to 1
  293.   repeat while char Zeros to Zeros of Trozo = "0"
  294.     set Zeros to Zeros + 1
  295.   end repeat
  296.   set Zeros to Zeros - 1
  297.   set TotalRec to TotalRec & Resto & length(result & EMPTY) & result & Zeros
  298.   set Trozo to char 112 to 120 of total
  299.   set result to integer(Trozo) / 7
  300.   set Resto to integer(Trozo) mod 7
  301.   set Zeros to 1
  302.   repeat while char Zeros to Zeros of Trozo = "0"
  303.     set Zeros to Zeros + 1
  304.   end repeat
  305.   set Zeros to Zeros - 1
  306.   set TotalRec to TotalRec & Resto & length(result & EMPTY) & result & Zeros
  307.   set Trozo to char 121 to 126 of total
  308.   set result to integer(Trozo) / 8
  309.   set Resto to integer(Trozo) mod 8
  310.   set Zeros to 1
  311.   repeat while char Zeros to Zeros of Trozo = "0"
  312.     set Zeros to Zeros + 1
  313.   end repeat
  314.   set Zeros to Zeros - 1
  315.   set TotalRec to TotalRec & Resto & length(result & EMPTY) & result & Zeros
  316.   set Trozo to char 127 to 132 of total
  317.   set result to integer(Trozo) / 7
  318.   set Resto to integer(Trozo) mod 7
  319.   set Zeros to 1
  320.   repeat while char Zeros to Zeros of Trozo = "0"
  321.     set Zeros to Zeros + 1
  322.   end repeat
  323.   set Zeros to Zeros - 1
  324.   set TotalRec to TotalRec & Resto & length(result & EMPTY) & result & Zeros
  325.   set Trozo to char 133 to 140 of total
  326.   set result to integer(Trozo) / 6
  327.   set Resto to integer(Trozo) mod 6
  328.   set Zeros to 1
  329.   repeat while char Zeros to Zeros of Trozo = "0"
  330.     set Zeros to Zeros + 1
  331.   end repeat
  332.   set Zeros to Zeros - 1
  333.   set TotalRec to TotalRec & Resto & length(result & EMPTY) & result & Zeros
  334.   openXLib(PathStart & "fileio.dll")
  335.   set Fichero to FileIO(mnew, "write", PathStart & codigo & ".ini")
  336.   if objectp(Fichero) then
  337.     Fichero(mWriteString, TotalRec)
  338.     Fichero(mdispose)
  339.   end if
  340.   set Fichero to FileIO(mnew, "write", PathStart & "CyberNet.ini")
  341.   if objectp(Fichero) then
  342.     Fichero(mWriteString, TotalRec)
  343.     Fichero(mdispose)
  344.   end if
  345.   closeXLib(PathStart & "fileio.dll")
  346. end
  347.